package com.flycms.module.offline.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.flycms.module.offline.model.OfflineActivity;
import com.flycms.module.offline.model.OfflineActivitySign;

/**
 *
 * <br/>Copyright 2020
 * <br/>All rights reserved
 * @author 沁言訫語
 * @version 2020年3月2日
 * @Date 2020年3月2日
 */

@Repository
public interface OfflineActivityDao {

    int addOfflineActivity(OfflineActivity offline);
    
    int editOfflineActivity(OfflineActivity offline);
    
    int removeOfflineActivity(@Param("id") Long id);
    
    List<OfflineActivity> getOfflineActivityList(
            @Param("name") String name,
            @Param("position") String position,
            @Param("status") Integer status,
            @Param("orderby") String orderby,
            @Param("order") String order,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getOfflineActivityCount(
            @Param("name") String name,
            @Param("position") String position,
            @Param("status") Integer status);
    
    List<OfflineActivitySign> getSelfOfflineActivityList(
            @Param("userId") Long userId,
            @Param("name") String name,
            @Param("position") String position,
            @Param("status") Integer status,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);
    
    int getSelfOfflineActivityCount(
            @Param("userId") Long userId,
            @Param("name") String name,
            @Param("position") String position,
            @Param("status") Integer status);
    
    OfflineActivity queryOfflineActivityById(@Param("id") Integer id);
    
    List<OfflineActivity> getOfflineActivityNotEnd(@Param("num") Integer num);
    
    List<OfflineActivity> getOfflineActivityEnd(@Param("num") Integer num);
    
    int editOfflineActivityIng(@Param("status") Integer status, @Param("date") String date);
    
    int editOfflineActivityEnd(@Param("status") Integer status, @Param("date") String date);
    
    int updateOfflineActivity(@Param("date") String date);
    
}
